using System;
using ACS.Runtime.Types;

namespace ACS.Runtime.Visitors
{
    public class TraceVisitor : IVisitor
    {
        public int Visit(IArrayType data)
        {
            return data.Iter(VisitArrayItem);
        }

        private int VisitArrayItem(BaseType field)
        {
            return field.Accept(this);
        }

        public int Visit(StringType data)
        {
            Console.WriteLine(data);
            return 0;
        }

        public int Visit(IntType data)
        {
            Console.WriteLine(data);
            return 0;
        }

        public int Visit(BoolType data)
        {
            Console.WriteLine(data);
            return 0;
        }
    }
}
